const config = require('../../config')
const axios = require('axios')
const logger = require('../../logger')

const instance = axios.create({
	baseURL : config.wcs.host,
	timeout : 10 * 1000
})

instance.interceptors.request.use(function(request) {
	logger.info(`请求wcs : url : ${request.url} method : ${request.method} ; data : ${request.data
		? JSON.stringify(request.data)
		: null}`)

	return request
})

module.exports = instance